home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
Xm
/
XmQTdialogShellSavvy.z
/
XmQTdialogShellSavvy
Wrap
Text File
|
1998-10-30
|
11KB
|
199 lines
XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))
NNNNAAAAMMMMEEEE
_X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y - A dialog widget holding this trait
can become a child of the XmDialogShell widget
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
#include <Xm/DialogSavvyT.h>
typedef struct {
int version;
XmDialogSavvyMapUnmapProc callMapUnmapCB;
} XmDialogSavvyTraitRec,*XmDialogSavvyTrait;
vvvvooooiiiidddd ((((****XXXXmmmmDDDDiiiiaaaallllooooggggSSSSaaaavvvvvvvvyyyyMMMMaaaappppUUUUnnnnmmmmaaaappppPPPPrrrroooocccc))))(
WWWWiiiiddddggggeeeetttt,
BBBBoooooooolllleeeeaaaannnn);
VVVVEEEERRRRSSSSIIIIOOOONNNN
This page documents Motif 2.1.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
A widget holding the _X_m_Q_T_d_i_a_l_o_g_S_a_v_v_y trait can become an
immediate child of the XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget. In other
words, the _X_m_Q_T_d_i_a_l_o_g_S_a_v_v_y trait announces to the
XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget that your widget is an acceptable
child.
Every dialog widget that holds the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y
trait must provide the following:
+o A ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB trait method
+o A default position resource
+o Code that detects an XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN
situation
Any widget that installs the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait must
provide a BBBBoooooooolllleeeeaaaannnn default position resource. For example,
EEEExxxxmmmmGGGGrrrriiiidddd and XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd both provide a BBBBoooooooolllleeeeaaaannnn default
position resource named XXXXmmmmNNNNddddeeeeffffaaaauuuullllttttPPPPoooossssiiiittttiiiioooonnnn. This resource
controls the positioning of the DialogShell managing your
_X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y widget. This resource has no influence
if your _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_ywidget is not managed by a
DialogShell. For example, if the parent of the DialogShell
is an ApplicationShell, then the center of the DialogShell
will be at the same coordinates as the center of the
ApplicationShell. If the DialogShell becomes unmapped (but
stays managed) and then remapped, this resource has no
influence on the DialogShell's position. If the default
position resource is False, the DialogShell does not
automatically center itself. Instead, the DialogShell (and
therefore its _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y child) will be positioned
according to the values of XXXXmmmmNNNNxxxx and XXXXmmmmNNNNyyyy. Motif will treat
Page 1 (printed 10/24/98)
XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))
the values of XXXXmmmmNNNNxxxx and XXXXmmmmNNNNyyyy as offsets from the upper-left
corner of the screen (rather than as offsets from the
upper-left corner of the parent shell).
The XXXXmmmm////DDDDiiiiaaaallllooooggggSSSSaaaavvvvvvvvyyyyTTTT....hhhh header file provides a special macro
constant named XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN. Any widget
holding the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait must use this
constant. Here is the problem that
XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN solves. The current position of
a dialog child widget within an XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllllwidget is
always 0,0. Suppose a user or application calls XXXXttttSSSSeeeettttVVVVaaaalllluuuueeeessss
to set the dialog child widget's x-coordinate or y-
coordinate to 0. In this case, the Intrinsics will not
detect a geometry change and will therefore not trigger a
geometry request. To tell the XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget that you
really do want the child to move to a coordinate of 0, your
dialog child widget must catch this request and respond to
it by setting the x-coordinate or y-coordinate to
XXXXmmmmDDDDIIIIAAAALLLLOOOOGGGG____SSSSAAAAVVVVVVVVYYYY____FFFFOOOORRRRCCCCEEEE____OOOORRRRIIIIGGGGIIIINNNN instead of 0. For example:
if (my_dialog_widget->core.x == 0)
my_dialog_widget->core.x = XmDIALOG_SAVVY_FORCE_ORIGIN;
...
if (my_dialog_widget->core.y == 0)
my_dialog_widget->core.y = XmDIALOG_SAVVY_FORCE_ORIGIN;
In the standard Motif widget set, the XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd widget
and all its subclasses hold the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait.
In the Exm demonstration widget set, the _E_x_m_G_r_i_d widget
installs the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait.
The XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll widget is the only standard Motif widget
that examines its children for this trait.
TTTThhhheeee ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB TTTTrrrraaaaiiiitttt MMMMeeeetttthhhhoooodddd
vvvvooooiiiidddd ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB(
WWWWiiiiddddggggeeeetttt ddddiiiiaaaallllooooggggWWWWiiiiddddggggeeeetttt,
BBBBoooooooolllleeeeaaaannnn mmmmaaaapppp____uuuunnnnmmmmaaaapppp);
All dialog widgets holding the _X_m_Q_T_d_i_a_l_o_g_S_h_e_l_l_S_a_v_v_y trait
must provide the ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB trait method. The
ccccaaaallllllllMMMMaaaappppUUUUnnnnmmmmaaaappppCCCCBBBB trait method is responsible for calling the
map or unmap callback of the widget. For example, following
is one possible way of implementing this trait method:
static void
CallMapUnmap(
Widget dialogWidget,
Boolean map_unmap)
{
ExmMyDialogWidget dw = (ExmMyDialogWidget) dialogWidget;
XmAnyCallbackStruct call_data;
Page 2 (printed 10/24/98)
XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmQQQQTTTTddddiiiiaaaallllooooggggSSSShhhheeeellllllllSSSSaaaavvvvvvvvyyyy((((3333XXXX))))
call_data.reason = map_unmap ? XmCR_MAP: XmCR_UNMAP;
call_data.event = NULL;
if (map_unmap)
XtCallCallbackList (dialogWidget, dw->my_dialog.map_callback,
&call_data);
else
XtCallCallbackList (dialogWidget, dw->my_dialog.unmap_callback,
&call_data);
}
_d_i_a_l_o_g_W_i_d_g_e_t
Specifies the dialog widget.
_m_a_p__u_n_m_a_p Specifies a BBBBoooooooolllleeeeaaaannnn value. If this value is _T_r_u_e,
then the trait method should invoke the map
callback. If this value is _F_a_l_s_e, then the trait
method should invoke the unmap callback.
RRRREEEELLLLAAAATTTTEEEEDDDD
XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd(3) and XXXXmmmmDDDDiiiiaaaallllooooggggSSSShhhheeeellllllll(3).
Page 3 (printed 10/24/98)